﻿Imports System.Data.OleDb

Public Class EditSanBay
    Inherits DataProvider

    Public Function Check(ByVal id As String) As Boolean
        Dim sql As String = "SELECT * FROM SanBay WHERE ID='" + id + "'"
        If GetDT(sql).Tables(0).Rows.Count() = 0 Then
            Return True
        End If
        Return False
    End Function

    Public Function save(ByVal dtosanbay As DTO.EditSanBay) As Integer
        Dim sqo As String = "UPDATE SANBAY SET TEN='" + dtosanbay.TenSanBay + "' ,GhiChu = '" + dtosanbay.GhiChu + "'Where ID = " + dtosanbay.MaSanBay.ToString
        Return Me.SaveData(sqo)
    End Function

    Public Function dtload(ByVal masb As Integer) As DataSet
        Dim sql As String = "SELECT * FROM SANBAY WHERE ID=" + masb.ToString
        Return GetDT(sql)
    End Function
End Class
